<template>
  <a-layout id="admin-layout-wrapper">
    <a-layout-sider :trigger="null" collapsible>
      <div class="logo">
        <span>知识库系统管理平台</span>
      </div>
      <a-menu theme="dark" mode="inline" :default-selected-keys="['1']">
        <template v-for="item in menuList">
          <a-sub-menu v-if="item.children.length>0" :key="item.name">
            <template slot="title">
              <svg-icon :icon-class="item.icon"></svg-icon>
              <span>{{item.text}}</span>
            </template>
            <a-menu-item v-for="subItem in item.children" :key="subItem.name">
              <svg-icon :icon-class="subItem.icon"></svg-icon>
              <span>{{subItem.text}}</span>
            </a-menu-item>
          </a-sub-menu>
          <a-menu-item v-else :key="item.name">
            <svg-icon :icon-class="item.icon"></svg-icon>
            {{item.text}}
          </a-menu-item>
        </template>
      </a-menu>
    </a-layout-sider>
    <a-layout>
      <a-layout-header style="background: #fff; padding: 0">

      </a-layout-header>
      <a-layout-content
          :style="{ margin: '10px 0px 0px 10px', padding: '12px', background: '#fff', minHeight: '280px' }"
      >
        <svg-icon icon-class="menu"></svg-icon>
        <span>导航菜单</span>
      </a-layout-content>
    </a-layout>
  </a-layout>
</template>

<script>
export default {
  name: "Admin",
  data() {
    return {
      menuList: [
        {
          name: 'menuManage',
          text: '菜单管理',
          icon: 'menu',
          children: [
            {name: 'topMenu', text: '顶部菜单', icon: 'top-menu', children: []},
            {name: 'sideMenu', text: '侧边菜单', icon: 'side-menu', children: []},
          ]
        },
        {
          name: 'userManage',
          text: '用户管理',
          icon: 'user',
          children: [

          ]
        },
        {
          name: 'systemSetting',
          text: '系统配置',
          icon: 'setting',
          children: []
        }
      ]
    }
  }
}
</script>

<style scoped>
#admin-layout-wrapper {
  height: 100%;
}
#admin-layout-wrapper .trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
}

#admin-layout-wrapper .trigger:hover {
  color: #1890ff;
}

#admin-layout-wrapper .logo {
  height: 32px;
  margin: 16px;
  text-align: center;
  line-height: 32px;
  color: #FFFFFF;
}
</style>